package com.allen.study.config;

import org.springframework.cloud.gateway.route.RouteLocator;
import org.springframework.cloud.gateway.route.builder.RouteLocatorBuilder;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @ClassName: GatewayConfig
 * @Author: AllenSun
 * @Date: 2025/3/22 00:56
 */
@Configuration
public class GatewayConfig {
    @Bean
    public RouteLocator customRouteLocator(RouteLocatorBuilder builder) {
        return builder.routes()
                .route("allen-admin", r -> r.path("/actuator/**")
                        .uri("http://localhost:8082/actuator"))
                .build();
    }
}
